/*
 * File:    VariableStoreInterface.java
 * Created: 10-Feb-2009
 * Version: $Id$
 *
 * COPYRIGHT (C) 2009, Bitgate Mobile, LLC.  All Rights Reserved.
 *
 * software@bitgatemobile.com
 */

package com.webplasm.store;

import java.util.Map;

import com.webplasm.store.VariableContainer.VariableType;

/**
 * This class serves as a template for variable store classes to store and retrieve data.
 * 
 * @author kenji
 * @since Webplasm 2
 */
public interface VariableStoreInterface {
	/**
	 * Returns the type of variable this class implements.
	 * 
	 * @return <code>VariableType</code> object.
	 */
	VariableType getType();
	
	/**
	 * Indicates whether the class implements a "standard" type of variable: a string or number.
	 * 
	 * @return <code>true</code> if this class is a simple type, <code>false</code> if it is complex.
	 */
	boolean isStandard();
	
	/**
	 * Indicates whether or not the class implements a named key/value pair variable interface.
	 * 
	 * @return <code>true</code> if mappable, <code>false</code> otherwise.
	 */
	boolean isMappable();
	
	/**
	 * Indicates whether or not the variable contains an iterative list.
	 * 
	 * @return <code>true</code> if it can be iterated, <code>false</code> otherwise.
	 */
	boolean isIterative();
	
	/**
	 * Indicates whether or not the variable store contains an array of objects.
	 * 
	 * @return <code>true</code> if it contains an array, <code>false</code> otherwise.
	 */
	boolean isArray();
	
	/**
	 * Assigns a variable to the store.
	 * 
	 * @param value The variable to store.
	 */
	void setValue(Object value);
	
	/**
	 * Returns the stored variable in a string form.
	 * 
	 * @return <code>String</code> containing the variable value.
	 */
	String getString();
	
	/**
	 * Returns the value as an integer.
	 * 
	 * @return <code>int</code> if the variable stored was an integer.
	 */
	int getInteger();
	
	/**
	 * Returns the value as a floating point integer.
	 * 
	 * @return <code>float</code> containing the value.
	 */
	double getFloat();
	
	/**
	 * Returns the object that was stored.
	 * 
	 * @return <code>Object</code> containing the value.
	 */
	Object getObject();
	
	/**
	 * Contains a mapped list of keys and like-stored variables.
	 * 
	 * @return <code>Map&lt;String, VariableStoreInterface&gt;</code> object list.
	 */
	Map<String, VariableStoreInterface> getMap();
}